﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace UpdaterForm
{
    [Serializable]
    public class UpdateLog : Observable
    {
        private String _failReason;
        private List<String> _transferedFiles;

        [XmlElement("UpdateName")]
        public String Name { get; set; }

        [XmlElement("ApplyTime")]
        public DateTime Time { get; set; }

        [XmlElement("State")]
        public UpdateState State { get; set; }

        [XmlElement("FailReason")]
        public String FailReason
        {
            get { return _failReason; }
            set
            {
                _failReason = value;
                OnPropertyChanged("FailReason");
            }
        }

        [XmlElement("TransferedFile")]
        public List<String> TransferedFiles
        {
            get
            {
                if (_transferedFiles == null)
                {
                    _transferedFiles = new List<string>();
                }
                return _transferedFiles;
            }
            set { _transferedFiles = value; }
        }
    }
}